<!DOCTYPE HTML>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-sealInfo-edit" th:object="${sealInfo}">
            <input id="sealId" name="sealId" th:field="*{sealId}"  type="hidden">
            <div class="form-group">	
                <label class="col-sm-3 control-label">公章名称：</label>
                <div class="col-sm-8">
                    <input id="sealNm" name="sealNm" th:field="*{sealNm}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">	
                <label class="col-sm-3 control-label">全路径名：</label>
                <div class="col-sm-8">
                    <input id="sealFilepath" name="sealFilepath" th:field="*{sealFilepath}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">	
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <input id="sealNote" name="sealNote" th:field="*{sealNote}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">	
                <label class="col-sm-3 control-label">模板名称：</label>
                <div class="col-sm-8">
					<select id="modId" name="modId" class="form-control m-b" th:with="type=${@ModInfoServiceImpl.selectModInfoAll()}">
						<option th:each="dict : ${type}" th:text="${dict.modNm}" th:value="${dict.modId}" th:field="*{modId}"></option>
					</select>
				</div>
            </div>
		</form>
    </div>
    <div th:include="include::footer"></div>
    <script type="text/javascript">
		var prefix = ctx + "evo/sealInfo"
		$("#form-sealInfo-edit").validate({
			rules:{
				sealNm:{
					required:true,
				},
			}
		});
		
		function submitHandler() {
	        if ($.validate.form()) {
	        	edit();
	        }
	    }
		
		function add() {
        	var sealId = $("input[name='sealId']").val();
        	var sealNm = $("input[name='sealNm']").val();
        	var sealFilepath = $("input[name='sealFilepath']").val();
        	var sealNote = $("input[name='sealNote']").val();
        	var modId = $("#modId option:selected").val();
        	$.ajax({
        		cache : true,
        		type : "POST",
        		url : ctx + "evo/sealInfo/edit",
        		data : {
        			"sealId": sealId,
        			"sealNm": sealNm,
        			"sealFilepath": sealFilepath,
        			"sealNote": sealNote,
        			"modId": modId
        		},
        		async : true,
        		error : function(request) {
        			$.modal.alertError("系统错误");
        		},
        		success : function(data) {
        			$.operate.saveSuccess(data);
        		}
        	});
        }
	</script>
</body>
</html>
